#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
#include "PL7_arraytp.h"

using std::cout;
using std::endl;
using std::cin;
using std::srand;
using std::rand;
using std::string;
int main(int argc, char const *argv[])
{
    ArrayTp<int,10> sums;
    ArrayTp<double,10> aves;
    ArrayTp< ArrayTp<int,5>, 10 > twodee;

    int i,j;
    for ( i = 0; i < 10; i++)
    {
        sums[i] = 0;
        for ( j = 0; j < 5; j++)
        {
            twodee[i][j] = (i+1)*(j+1);
            sums[i] += twodee[i][j];
        }
        aves[i] =(double) sums[i]/5;
    }
    cout <<"------------"<< endl;
    for ( i = 0; i < 10; i++)
    {
        for ( j = 0; j < 5; j++)
        {
            cout << twodee[i][j] << " ";
        }
        cout<<"\t|\t"<<sums[i]<<"\t|\t"<<aves[i] << endl;
    }
    return 0;
}
